package com.lwm.mybatis.custom.sqlsession;

import com.lwm.mybatis.custom.cfg.Configuration;
import com.lwm.mybatis.custom.sqlsession.defaults.DefaultSqlSessionFactory;
import com.lwm.mybatis.custom.utils.XMLConfigBuilder;

import java.io.InputStream;

/**
 * 创建一个SqlSessionFactory
 *
 * @author liweimin
 * @date 2021/6/15 17:03
 * @since
 */
public class SqlSessionFactoryBuilder {

    public SqlSessionFactory build(InputStream config) {
        Configuration configuration = XMLConfigBuilder.loadConfiguration(config);

        return new DefaultSqlSessionFactory(configuration);
    }

}
